package com.atguigu.biliplayer.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import java.util.List;

/**
 * 分类型适配器的基类
 * Created by 刘晨龙 on 2015/11/5.
 */
public abstract class BaseAdapter<T> extends RecyclerView.Adapter {

    private final LayoutInflater mInflater;
    private final List<T> mDatas;

    public BaseAdapter(Context context,List<T> datas){
        mInflater = LayoutInflater.from(context);
        mDatas = datas;
    }

    @Override
    public abstract RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType);

    @Override
    public abstract void onBindViewHolder(RecyclerView.ViewHolder holder, int position);

    @Override
    public int getItemCount() {
        return mDatas.size();
    }

    @Override
    public int getItemViewType(int position) {
        return super.getItemViewType(position);
    }
}
